<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex contact_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-stretch justify-between contact_fd0_0'>
					<view class='flex flex-wrap align-center contact_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">
						<text class='fu-iconfont2  contact_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='contact_fd0_0_c1_c0'>团购核销</text>
					</view>
					<view class='flex align-center justify-end contact_fd0_0_c2'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---版本flex布局开始-->

			<view class="imaClass">
				<image src="../../../static/images/兑换券.png" mode="aspectFill" class="iaclas"></image>
			</view>


			<view class='flex flex-direction flex-wrap align-stretch personalCenter_fd2_0'>

				<view style="display: flex;align-items: center;">
					<view class='flex flex-wrap align-center justify-between personalCenter_fd2_0_c1'>
						<view class='flex flex-direction flex-wrap align-center personalCenter_fd2_0_c1_c0'
							@tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/homePage/qrcode/qrcode`">
							<image class='personalCenter_fd2_0_c1_c0_c0' mode="aspectFit" src='../../../static/images/抖音.png'>
							</image>
							<text class='personalCenter_fd2_0_c1_c0_c1'>抖音</text>
						</view>
					</view>

					<!-- 					<view class='flex flex-wrap align-center justify-between personalCenter_fd2_0_c1'>
						<view class='flex flex-direction flex-wrap align-center personalCenter_fd2_0_c1_c0'
							@tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/myB/ticketWriteOff/ticketWriteOff`">
							<image class='personalCenter_fd2_0_c1_c0_c0' mode="aspectFit" src='../../../static/tab/17.png'>
							</image>
							<text class='personalCenter_fd2_0_c1_c0_c1'>团购核销</text>
						</view>
					</view> -->

					<!-- 					<view class='flex flex-wrap align-center justify-between personalCenter_fd2_0_c1'>
						<view class='flex flex-direction flex-wrap align-center personalCenter_fd2_0_c1_c0'
							@tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/myB/ticketWriteOff/ticketWriteOff`">
							<image class='personalCenter_fd2_0_c1_c0_c0' mode="aspectFit" src='../../../static/tab/35.png'>
							</image>
							<text class='personalCenter_fd2_0_c1_c0_c1'>团购核销</text>
						</view>
					</view> -->

				</view>
			</view>

			<view class='flex flex-wrap align-center justify-between designPicture_fd1_0'>
				<view class='flex flex-wrap align-center flex-sub designPicture_fd1_0_c0'>
					<input class='flex-sub designPicture_fd1_0_c0_c0' type="text" :placeholder="`请输入核销券码`" confirm-type="done"
						:maxlength="-1" placeholder-style="color:#999;font-size:24rpx" v-model="code" @confirm="codeOff" />
				</view>
			</view>

			<view class="flex flex-direction flex-wrap align-center">
				<button class='contact_fd1_3' style="margin-top: 50rpx;" @tap="codeOff">确定核销</button>
			</view>


			<benben-popup v-model="popupShow165699235080066" :mask="true" :mask-close-able="true" mode='center'>
				<!---退出登录flex布局开始-->
				<view class="flex flex-direction flex-wrap align-center system_flex_2">
					<text class='system_fd2_0'>提示</text>
					<text class='system_fd2_1'>确定核销吗？</text>
					<view class='flex align-center system_fd2_2'>
						<button class='system_fd2_2_c0' @tap.stop="popupShow165699235080066=false">取消</button>
						<button class='system_fd2_2_c1' @tap.stop="submit()">确定</button>
					</view>
				</view>

				<!---退出登录flex布局结束-->

			</benben-popup>



			<!---版本flex布局结束-->


		</view>
	</view>
</template>
<script>
	export default {
		components: {},


		data() {
			return {
				code: '',
				popupShow165699235080066: false,
				coodeInfo: ''
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			isLogin() {
				return this.$store.state.token == '' ? false : true;
			},

		},
		watch: {},
		onLoad(options) {},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {

			async codeOff() {

				let res = await this.$api.post(global.apiUrls.WriteOffquery, {
					osType: 1,
					code: this.code
				});
				if (res.data.code != 200) {
					this.$message.info(res.data.msg);
					return
				}
				this.coodeInfo = res.data.data
				this.popupShow165699235080066 = true
			},

			async submit() {
				let phone = uni.getStorageSync('keyPhone')
				let res = await this.$api.post(global.apiUrls.WriteOffcheck, {
					phoneNumber: phone,
					accountId: this.coodeInfo.accountId,
					certificateId: this.coodeInfo.certificateId,
					code: this.coodeInfo.code,
					encryptedCode: this.coodeInfo.encryptedCode,
					gymId: this.coodeInfo.gymId,
					gymName: this.coodeInfo.gymName,
					orderId: this.coodeInfo.orderId,
					osType: 1,
					ticketName: this.coodeInfo.ticketName
				});
				if (res.data.code != 200) {
					this.$message.info({
						content: res.data.msg,
						duration: 2000
					});
					return
				}
				this.coodeInfo = res.data.data
				this.popupShow165699235080066 = false
				this.$message.info('核销成功');
			},


		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.unputc {
		width: 680rpx;
		height: 88rpx;
	}

	.designPicture_flex_1 {
		background: var(--benbenbgColor1);
		width: 750rpx;
		height: 93rpx;
		overflow: hidden;
		z-index: 10;
		top: 88rpx;
		background-size: #eee;
	}

	.designPicture_fd1_0_c1 {
		width: 40rpx;
		height: 40rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.designPicture_fd1_0_c0_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
	}

	.designPicture_fd1_0_c0 {
		background: #f1f1f1;
		height: 64rpx;
		background-size: 100% auto !important;
		border-radius: 34rpx 34rpx 34rpx 34rpx;
		padding: 0rpx 20rpx 0rpx 32rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
	}

	.designPicture_fd1_0 {
		padding: 0rpx 32rpx 0rpx 20rpx;
		line-height: 93rpx;
		margin: 20rpx 0rpx 0rpx 0rpx;
	}

	.personalCenter_fd2_0_c1_c0_c1 {
		color: var(--benbenFontColor0);
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
		margin: 16rpx 0rpx 0rpx 0rpx;
	}

	.personalCenter_fd2_0_c1_c0_c0 {
		width: 120rpx;
		height: 120rpx;
	}

	.personalCenter_fd2_0_c1_c0 {
		position: relative;
		width: 150rpx;
	}

	.personalCenter_fd2_0_c1 {
		margin: 32rpx 0rpx 0rpx 0rpx;
	}

	.personalCenter_fd2_0_c0_c0 {
		color: rgba(51, 51, 51, 1);
		font-size: 28rpx;
		font-weight: 400;
	}

	.personalCenter_fd2_0 {
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 24rpx 16rpx 25rpx 24rpx;
		margin: 20rpx 0rpx 0rpx 0rpx;
	}

	// .imaClass {
	// 	width: 750rpx;
	// 	height: 400rpx;
	// }

	.iaclas {
		width: 750rpx;
		height: 400rpx;
	}

	.contact_fd1_3 {
		background: #167deb;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		width: 686rpx;
		line-height: 78rpx;
		font-size: 32rpx;
		color: #fff;
		height: 78rpx;
		font-weight: 500;
	}

	.system_flex_2 {
		background: #fff;
		width: 540rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.system_fd2_0 {
		font-size: 36rpx;
		font-weight: 800;
		line-height: 44rpx;
		color: #333333;
		margin: 40rpx 0rpx 40rpx 0rpx;
	}

	.system_fd2_1 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: rgba(102, 102, 102, 1);
	}

	.contact_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.system_fd2_2_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: transparent;
		line-height: 110rpx;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: #167deb;
		width: 268rpx;
	}

	.system_fd2_2_c0 {
		border-top: 1px solid #eee;
		background: #fff;
		line-height: 110rpx;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		padding: 0rpx 103rpx 0rpx 103rpx;
	}

	.system_fd2_2 {
		margin: 37rpx 0rpx 0rpx 0rpx;
	}

	.contact_fd0_0_c2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		width: 100rpx;
	}

	.contact_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: var(--benbenFontColor0);
		line-height: 50rpx;
	}

	.contact_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
	}

	.contact_fd0_0_c0 {
		width: 100rpx;
	}

	.contact_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.contact_fd1_3 {
		background: #167deb;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		width: 638rpx;
		line-height: 88rpx;
		font-size: 32rpx;
		color: #fff;
		height: 88rpx;
		font-weight: 500;
	}

	.contact_fd1_2 {
		color: #999999;
		font-size: 26rpx;
		font-weight: 400;
		margin: 0rpx 0rpx 94rpx 0rpx;
	}

	.contact_fd1_1_c0 {
		font-weight: 700;
		color: #333333;
		font-size: 48rpx;
	}

	.contact_fd1_1 {
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.contact_fd1_0 {
		width: 334rpx;
		height: 333rpx;
		margin: 73rpx 0rpx 048rpx 0rpx;
	}
</style>